home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Maclife 40
/
MACLIFE40.ISO.7z
/
MACLIFE40.ISO
/
MACLIFE連載
/
特集II DTPデザインを効率化
/
AppleScript⁄サンプル
/
SampleScript
/
PhotoShopScript
/
Auto Action 0.9
/
Auto Action.txt
< prev
next >
Wrap
Text File
|
1998-02-10
|
3KB
|
90 lines
on run
with timeout of 6000 seconds
set Dolop_List to {}
tell application "Finder"
activate
repeat with sFile in selection
set Dolop_List to Dolop_List & (sFile as alias)
end repeat
if Dolop_List is {} then display dialog "please select files or folders!!!"
if (name of item 1 of Dolop_List as string) is "Aoto Action" then
set Dolop_List to {}
repeat
try
choose file with prompt "処理するファイルを順に選んでください。"
set Dolop_List to Dolop_List & result
on error errMsg number ERRNO
if ERRNO is -128 then --キャンセルが押されたら
exit repeat
else --それ以外の不意打ちには
error errMsg & ERRNO
exit repeat
end if
end try
end repeat
end if
display dialog "実行するアクションの名前を入力してください" default answer "名称未設定 1"
set Action_name to text returned of result
my Action_G(Action_name, Dolop_List)
end tell
end timeout
end run
on open Dolop_List
with timeout of 6000 seconds
tell application "Finder"
end tell
display dialog "実行するアクションの名前を入力してください" default answer "名称未設定 1" default button 3
set Action_name to text returned of result
my Action_G(Action_name, Dolop_List)
end timeout
end open
on Action_G(Action_name, Dolop_List)
tell application "Finder"
set File_list to {}
set File_Type to {"TIFF", "8BPS", "BMP", "EPSF", "JPEG", "PCX", "PDF", "PICT", "SCRN", "PXR", "PNGf", "..CT", "TPIC"} as list
set AA to 0
set BB to 0
repeat with i in Dolop_List
--try
if disk (i as string) exists then
set Check_disk to every file of entire contents of disk (i as string) --disk中の全てのファイルを再帰的に拾う
my Action_G(Action_name, Check_disk)
else if folder (i as string) exists then
set Check_Folder to every file of entire contents of folder (i as string) --folder中の全てのファイルを再帰的に拾う
my Action_G(Action_name, Check_Folder)
else if (file type obsolete of i as string) is in File_Type then
--and (size of i) > (250000) then --こうやってサイズを制限することも可能
--ここでアクションしてまんねん
tell application "Adobe Photoshop(R) 4.0.1J"
open file (i as string)
do script Action_name
end tell
set AA to AA + 1
else
--display dialog (name of i as string) & "は処理できません"
set BB to BB + 1
end if
try
on error errMsg number ERRNO --エラー処理
if ERRNO is -1728 then --クリエータが特定できない
display dialog (name of i as string) & "は処理できません" & return & errMsg & ERRNO
else --それ以外の不意打ちには
display dialog "エラーが起きました" & return & errMsg & ERRNO
exit repeat
end if
end try
end repeat
beep 3
display dialog (AA as text) & "個のファイルを処理しました" & return & (BB as text) & "個のファイルは未処理です"
end tell
end Action_G